<!--
*Author：DGZ
 **  contact:service@dagongzao.com
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/sys/system/Sys_Region.jsx此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :details="details"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/sys/system/Sys_Region.jsx";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'RegionId',
                editTable:true ,
                footer: "Foots",
                cnName: '省市区县',
                name: 'system/Sys_Region',
                newTabEdit: false,
                url: "/Sys_Region/",
                sortName: "RegionId"
            });
            const editFormFields = ref({"RegionCode":"","RegionName":"","ParentCode":"","RegionLevel":"","MerName":"","Lng":"","Lat":""});
            const editFormOptions = ref([[{"title":"编码","field":"RegionCode"},
                               {"title":"名称","field":"RegionName"},
                               {"title":"上级编码","field":"ParentCode","type":"number"},
                               {"title":"级别","field":"RegionLevel","type":"number"},
                               {"title":"完整地址","field":"MerName"},
                               {"title":"经度","field":"Lng","type":"decimal"},
                               {"title":"纬度","field":"Lat","type":"decimal"}]]);
            const searchFormFields = ref({"RegionName":"","RegionLevel":"","MerName":"","PinYin":""});
            const searchFormOptions = ref([[{"title":"名称","field":"RegionName"},{"title":"级别","field":"RegionLevel","type":"number"},{"title":"完整地址","field":"MerName","type":"like"},{"title":"拼音","field":"PinYin","type":"like"}]]);
            const columns = ref([{field:'RegionId',title:'RegionId',type:'int',width:110,hidden:true,require:true,align:'left'},
                       {field:'RegionCode',title:'编码',type:'string',width:70,edit:{type:''},align:'left'},
                       {field:'RegionName',title:'名称',type:'string',width:100,edit:{type:''},align:'left'},
                       {field:'ParentCode',title:'上级编码',type:'int',width:70,edit:{type:''},align:'left'},
                       {field:'RegionLevel',title:'级别',type:'int',width:50,edit:{type:''},align:'left'},
                       {field:'MerName',title:'完整地址',type:'string',width:140,edit:{type:''},align:'left'},
                       {field:'Lng',title:'经度',type:'decimal',width:70,edit:{type:''},align:'left'},
                       {field:'Lat',title:'纬度',type:'decimal',width:70,edit:{type:''},align:'left'},
                       {field:'PinYin',title:'拼音',type:'string',width:100,align:'left'},
                       {field:'Remarks',title:'备注',type:'string',width:120,align:'left'},
                       {field:'IsValid',title:'逻辑删除',type:'int',width:120,hidden:true,require:true,align:'left'}]);
            const detail = ref({columns:[]});
            const details = ref([]);
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
                details
            };
        },
    });
</script>
